import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * 项目名称：dubbo-learning
 * 类名称：Main
 * 类描述：Main
 * 创建时间：2022/2/15
 *
 * @author sisyphus   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
public class Main {

    public static void main(String[] args) throws IOException {

        for (int i = 12; i < 201; i++) {
//            String a = "package dubbo.learning.service;\n" +
//                    "\n" +
//                    "public interface ZService" + i + " {\n" +
//                    "\n" +
//                    "    void foo(String a);\n" +
//                    "\n" +
//                    "}\n";
//
//            File file = new File("C:\\code\\gitee\\dubbo-learning\\dubbo3\\dubbo3-service\\src\\main\\java\\dubbo\\learning\\service\\ZService" + i + ".java");
//


            String a = "package dubbo.learning.service.impl;\n" +
                    "\n" +
                    "import dubbo.learning.service.*;\n" +
                    "import org.apache.dubbo.config.annotation.DubboService;\n" +

                    "@DubboService\n" +
                    "public class ZService" + i + "Impl implements ZService" + i + " {\n" +
                    "    public void foo(String a) {\n" +
                    "\n" +
                    "    }\n" +
                    "}\n";

            File file = new File("C:\\code\\gitee\\dubbo-learning\\dubbo3\\dubbo3-service\\src\\main\\java\\dubbo\\learning\\service\\impl\\ZService" + i + "Impl.java");


            if (!file.getParentFile().exists()) {
                file.getParentFile().mkdirs();
            }

            Writer out = new FileWriter(file);
            out.write(a);
            out.close();
        }
    }
}
